package com.feng.zhihao.apigeteway.exception;

import com.xiaoleilu.hutool.util.StrUtil;

public class GetewayException extends java.lang.RuntimeException{

	/**
	 * 
	 */
	private static final long serialVersionUID = 5457177571787823196L;
	String code;
	String message;
	public GetewayException(Throwable cause,ExceptionMessage exceptionMessage) {
		this(cause,exceptionMessage,exceptionMessage.getMessage());
	}
	public GetewayException(Throwable cause,ExceptionMessage exceptionMessage,String... params) {
		super(StrUtil.format(exceptionMessage.getMessage(), params),cause);
		this.code=exceptionMessage.getCode();
		this.message=StrUtil.format(exceptionMessage.getMessage(), params);
	}
	public String getCode() {
		return code;
	}
	public void setCode(String code) {
		this.code = code;
	}
	public String getMessage() {
		return message;
	}
	public void setMessage(String message) {
		this.message = message;
	}
	
}
